﻿<Page x:Class="AvalonLibraryTest.Pages.Text"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:av="http://schemas.codeplex.com/wpfcontrib/xaml/presentation"
      xmlns:sys="clr-namespace:System;assembly=mscorlib"
      Title="Text">
    <FrameworkElement.Resources>
        <sys:String x:Key="TheText">
            I am leaving this harbour
            giving urban a farewell
            its habitants seem too keen on God
            I cannot stomach their rights and wrongs

            I have lost my origin
            and I don't want to find it again
            rather sailing into nature's laws
            and be held by ocean's paws

            (Wanderlust, Volta, Björk)
        </sys:String>
    </FrameworkElement.Resources>
    <av:AutoGrid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="0.5*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="0.5*" />
        </Grid.RowDefinitions>
        <TextBlock FontWeight="Bold"
                   Text="AnimatedTextBlock" />
        <DockPanel>
            <StackPanel DockPanel.Dock="Top"
                        Orientation="Horizontal">
                <TextBlock Text="Segment Length"
                           Margin="5" />
                <ComboBox Margin="5"
                          SelectedItem="{Binding ElementName=AnimatedTextBlock, Path=SegmentLength}">
                    <sys:Int32>1</sys:Int32>
                    <sys:Int32>2</sys:Int32>
                    <sys:Int32>3</sys:Int32>
                    <sys:Int32>4</sys:Int32>
                    <sys:Int32>5</sys:Int32>
                    <sys:Int32>6</sys:Int32>
                    <sys:Int32>7</sys:Int32>
                    <sys:Int32>8</sys:Int32>
                    <sys:Int32>9</sys:Int32>
                    <sys:Int32>10</sys:Int32>
                </ComboBox>
                <TextBlock Text="Mode"
                           Margin="5" />
                <ComboBox Margin="5"
                          SelectedItem="{Binding ElementName=AnimatedTextBlock, Path=Mode}">
                    <av:AnimatedTextMode>None</av:AnimatedTextMode>
                    <av:AnimatedTextMode>Reveal</av:AnimatedTextMode>
                    <av:AnimatedTextMode>Hide</av:AnimatedTextMode>
                    <av:AnimatedTextMode>RevealAndHide</av:AnimatedTextMode>
                    <av:AnimatedTextMode>Spotlight</av:AnimatedTextMode>
                </ComboBox>
                <TextBlock Text="Order"
                           Margin="5" />
                <ComboBox Margin="5"
                          SelectedItem="{Binding ElementName=AnimatedTextBlock, Path=Order}">
                    <av:AnimatedTextOrder>Forward</av:AnimatedTextOrder>
                    <av:AnimatedTextOrder>Backward</av:AnimatedTextOrder>
                    <av:AnimatedTextOrder>Random</av:AnimatedTextOrder>
                </ComboBox>
                <CheckBox Content="Continuous"
                          Margin="5"
                          Checked="CheckBox_Checked"
                          Unchecked="CheckBox_Checked"
                          IsChecked="True" />
            </StackPanel>
            <av:AnimatedTextBlock x:Name="AnimatedTextBlock"
                                  Text="{StaticResource TheText}"
                                  FontSize="20"
                                  FontWeight="Bold"
                                  Foreground="HotPink"
                                  RepeatBehavior="Forever"
                                  FontFamily="Palatino Linotype"
                                  Typography.Capitals="SmallCaps"
                                  TextWrapping="Wrap"
                                  TextAlignment="Justify" />
        </DockPanel>
    </av:AutoGrid>
</Page>
